#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=2e5+100;
typedef long long LL;
typedef pair<LL,LL> P;
map<LL,LL>map1;
LL a[maxn];
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  LL t;cin>>t;
  while(t--){
    LL n;cin>>n;
    map1.clear();
    LL mx=1e18;
    for(LL i=1;i<=n;i++){
        cin>>a[i];
        map1[a[i]]++;
    }
    bool flag=1;
    for(auto i: map1){
       if(i.second>1) continue;
        else{
            flag=0;
            mx=min(mx,i.first);
            break;
        }
    }
    if(flag) cout<<"-1"<<endl;
    else {
        for(LL i=1;i<=n;i++){
            if(a[i]==mx){
                cout<<i<<endl;
                break;
            }
        }
    }
  }
return 0;
}
